package com.jckj.core.config;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * 全局配置类
 * @author ThinkGem
 * @version 2014-06-25
 */
public class Global {

	/**
	 * 当前对象实例
	 */
	private static Global global = new Global();

	/**
	 * 显示/隐藏
	 */
	public static final String SHOW = "1";
	public static final String HIDE = "0";

	/**
	 * 是/否
	 */
	public static final String YES = "1";
	public static final String NO = "0";
	
	/**
	 * 对/错
	 */
	public static final String TRUE = "true";
	public static final String FALSE = "false";
	
	/**
	 * 获取当前对象实例
	 */
	public static Global getInstance() {
		return global;
	}

	/**
	 * 保存全局属性值,属性来源于数据库
	 */
	private static Map<String, String> SYSCONFIG = Maps.newHashMap();

	/**
	 *　返回当前系统配置
	 * @return
	 */
	public static Map<String, String> getSysconfig(){
		return SYSCONFIG;
	}

	/**
	 * 更新系统配置
	 * @param configs
	 */
	public static void setSysConfig(Map<String, String> configs){
		SYSCONFIG.putAll(configs);
	}

	/**
	 * 查询某一系统配置项
	 * @param key
	 * @return
	 */
	public static String getSysConfigByKey(String key){
		return SYSCONFIG.get(key);
	}


	
}
